package com.ezjie.ielts.util;

import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.Drawable;

import com.ezjie.ielts.R;

public class PlayAnimationUtils {

	/**
	 * 播放单词和例句时的动画
	 */
	public static AnimationDrawable PlayWordAnimation(Context context) {
		final AnimationDrawable animationDrawable = new AnimationDrawable();
		if (context != null) {
			Drawable m_D1 = context.getResources().getDrawable(R.drawable.laba);
			Drawable m_D2 = context.getResources().getDrawable(R.drawable.laba2);
			Drawable m_D3 = context.getResources().getDrawable(R.drawable.laba3);
			animationDrawable.addFrame(m_D1, 300);
			animationDrawable.addFrame(m_D2, 300);
			animationDrawable.addFrame(m_D3, 300);
			animationDrawable.setOneShot(false);
		}
		return animationDrawable;
	}
}
